<template>
	<form-frame v-model="visible" title="公告" width="992" :type="formType" :loading="btnLoading" @submit="handleSubmitForm()">
		<el-form ref="form" size="medium" :model="formData" :rules="formRules" v-loading="loading">
			<el-row :gutter="20" class="notice_form_container">
				<el-col :span="16">
					<el-form-item label="公告名称" prop="title">
						<el-input v-model="formData.title"></el-input>
					</el-form-item>
					<el-form-item label="文章内容" prop="content">
						<u-editor v-model="formData.content" :ue-height="250"></u-editor>
					</el-form-item>
					<el-row>
						<el-col :span="12">
							<el-form-item label="发布时间">
								<el-date-picker v-model="formData.releaseTime" type="date" value-format="yyyy-MM-dd" placeholder="选择发布时间"></el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="序号">
								<el-input-number v-model="formData.sort" controls-position="right" :min="1"></el-input-number>
							</el-form-item>
						</el-col>
					</el-row>
				</el-col>
				<el-col :span="8">
					<el-form-item label="公告附件" prop="attrList">
						<sw-file-uploader v-model="formData.attrList">
							<template slot="tip">
								建议上传大小小于1000MB格式为excel,ppt,doc,jpg,jpeg,png,bmp,xls,gif,xlsx,pdf,docx,xml,mp3,mp4,eml,avi,wav,pptx,wav,wma,flac,midi,ra,ape,flv,mkv,vtt,fbx,obj,gltf,ply,stl,osgb,zip,rar,txt的文件
							</template>
						</sw-file-uploader>
					</el-form-item>
				</el-col>
			</el-row>
		</el-form>
	</form-frame>
	<!-- <el-dialog :title="dialogTitle" :visible.sync="visible" append-to-body width="992px">
		<el-form ref="form" size="medium" :model="formData" :rules="formRules" class="sw_dialog_form">
			<el-row :gutter="20" class="notice_form_container">
				<el-col :span="16">
					<el-form-item label="公告名称" prop="title">
						<el-input v-model="formData.title"></el-input>
					</el-form-item>
					<el-form-item label="文章内容" prop="content">
						<u-editor v-model="formData.content" :ue-height="250"></u-editor>
					</el-form-item>
					<el-row>
						<el-col :span="12">
							<el-form-item label="发布时间">
								<el-date-picker v-model="formData.releaseTime" type="date" value-format="yyyy-MM-dd" placeholder="选择发布时间"></el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="序号">
								<el-input-number v-model="formData.sort" controls-position="right" :min="1"></el-input-number>
							</el-form-item>
						</el-col>
					</el-row>
				</el-col>
				<el-col :span="8">
					<el-form-item label="公告附件" prop="attrList">
						<sw-file-uploader v-model="formData.attrList">
							<template slot="tip">
								建议上传大小小于1000MB格式为excel,ppt,doc,jpg,jpeg,png,bmp,xls,gif,xlsx,pdf,docx,xml,mp3,mp4,eml,avi,wav,pptx,wav,wma,flac,midi,ra,ape,flv,mkv,vtt,fbx,obj,gltf,ply,stl,osgb,zip,rar,txt的文件
							</template>
						</sw-file-uploader>
					</el-form-item>
				</el-col>
			</el-row>
		</el-form>
		<template slot="footer">
			<el-button size="medium" @click="visible = false">取消</el-button>
			<el-button size="medium" type="primary" :loading="btnLoading" @click="handleSubmitForm()">提交</el-button>
		</template>
	</el-dialog> -->
</template>

<script>
import formMixins from '@/views/common/formMixins';
import { queryJournalism, addedJournalism, updateJournalism } from '@/api/platform/tbSysJournalism';
export default {
	mixins: [formMixins],
	data() {
		return {
			formRules: {
				title: [{ required: true, message: '请输入公告名称', trigger: 'blur' }]
			}
		};
	},
	methods: {
		//获取数据详情
		getDataDetail() {
			let params = { id: this.dataId, isRecord: '2' };
			this.getFormDetail(queryJournalism, params);
		},

		handleSubmitForm() {
			let params = { ...this.formData };
			this.handleSubmitFunction(params, addedJournalism, updateJournalism);
		}
	}
};
</script>

<style lang="scss" scoped>
.notice_form_container::v-deep {
	.el-form-item__label {
		display: block;
		float: none;
		line-height: 1;
		text-align: left;
		margin-bottom: 10px;
	}
}
</style>
